import request from '@/utils/request'
import { SET_CHANNELS } from '../actionTypes'
export const getChannel = () => {
  return async (dispatch) => {
    // 发请求 拿数据
    const res = await request({
      url: '/channels',
      method: 'GET'
    })
    console.log('getchanels', res)
    // // 2. 保存token到redux
    dispatch({ type: SET_CHANNELS, payload: res.data.channels })
  }
}
